Skip to content

fix(dashboard): Activate fallback locale before extensions - #5061

Merged
dlhck merged 3 commits into
masterfrom
fix-dashboard-lingui-race
Jul 30, 2026
Merged

fix(dashboard): Activate fallback locale before extensions#5061
dlhck merged 3 commits into
masterfrom
fix-dashboard-lingui-race

Conversation

@dlhck

@dlhck dlhck commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes a dashboard startup race where extensions could call Lingui translation functions before the asynchronous default catalog activated a locale. The source locale now activates synchronously with an empty catalog while the compiled dashboard and plugin catalogs continue loading in parallel, and a regression test covers extension evaluation during that window.

Breaking changes

No.

Screenshots

Not applicable.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vendure-storybook Ready Ready Preview Jul 30, 2026 7:51am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fa7f7660-3488-4a8e-b102-70c85143c1a9

📥 Commits

Reviewing files that changed from the base of the PR and between 190ef65 and ec428c3.

📒 Files selected for processing (1)
  • docs/manifest.json

📝 Walkthrough

Walkthrough

The i18n provider synchronously loads and activates an empty catalog for defaultLocale. A new test mocks dashboard extension execution and verifies that early translation evaluation completes without errors while the default locale remains active. The Vite plugin documentation updates generated source metadata, expands tempCompilationDir guidance, and refreshes its modification timestamp.

Possibly related PRs

Suggested reviewers: michaelbromley

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and clearly matches the main change: synchronizing the fallback locale before extensions run.
Description check ✅ Passed The description follows the template and includes the change summary, breaking changes, screenshots, and checklist; only the related issue is not linked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-dashboard-lingui-race

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Dashboard Preview: https://admin-dashboard-8c1ykyc1n-vendure.vercel.app

@dlhck dlhck changed the title fix(dashboard): activate fallback locale before extensions fix(dashboard): Activate fallback locale before extensions Jul 30, 2026
@dlhck
dlhck marked this pull request as ready for review July 30, 2026 07:38
@dlhck
dlhck changed the base branch from minor to master July 30, 2026 07:38
@dlhck
dlhck requested a review from michaelbromley as a code owner July 30, 2026 07:38
Dashboard extensions can evaluate translation calls before the asynchronous default catalog finishes loading. Activate an empty source-locale catalog synchronously so extension imports and compiled catalog loading remain parallel without triggering Lingui's missing-locale error.
@michaelbromley
michaelbromley enabled auto-merge (squash) July 30, 2026 07:44
@vendure-developer-hub

vendure-developer-hub Bot commented Jul 30, 2026

Copy link
Copy Markdown

Docs previewPR merged

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/docs/reference/dashboard/vite-plugin/vendure-dashboard-plugin.mdx`:
- Line 7: Update the source JSDoc in the `vendureDashboardPlugin` implementation
within `vite-plugin-vendure-dashboard.ts`, including the metadata and
`tempCompilationDir` documentation, rather than editing generated reference
output. Regenerate the reference documentation so the corresponding changes
appear under `docs/docs/reference/`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c04df112-80e0-463c-abe3-94071ede3d77

📥 Commits

Reviewing files that changed from the base of the PR and between b0ebd3d and 190ef65.

📒 Files selected for processing (1)
  • docs/docs/reference/dashboard/vite-plugin/vendure-dashboard-plugin.mdx

## vendureDashboardPlugin

<GenerationInfo sourceFile="packages/dashboard/vite/vite-plugin-vendure-dashboard.ts" sourceLine="242" packageName="@vendure/dashboard" since="3.4.0" />
<GenerationInfo sourceFile="packages/dashboard/vite/vite-plugin-vendure-dashboard.ts" sourceLine="254" packageName="@vendure/dashboard" since="3.4.0" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Update the source JSDoc instead of editing generated reference output.

This file is auto-generated, so these metadata and tempCompilationDir documentation changes will be overwritten. Apply the documentation changes in packages/dashboard/vite/vite-plugin-vendure-dashboard.ts and regenerate the reference docs.

As per path instructions, docs/docs/reference/**: Do not edit files in docs/docs/reference/ directly - they are auto-generated by scripts and will be overwritten.

Also applies to: 26-26, 88-98

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/docs/reference/dashboard/vite-plugin/vendure-dashboard-plugin.mdx` at
line 7, Update the source JSDoc in the `vendureDashboardPlugin` implementation
within `vite-plugin-vendure-dashboard.ts`, including the metadata and
`tempCompilationDir` documentation, rather than editing generated reference
output. Regenerate the reference documentation so the corresponding changes
appear under `docs/docs/reference/`.

Source: Path instructions

@sonarqubecloud

Copy link
Copy Markdown

@dlhck
dlhck disabled auto-merge July 30, 2026 08:08
@dlhck
dlhck merged commit aaa2eb0 into master Jul 30, 2026
38 checks passed
@dlhck
dlhck deleted the fix-dashboard-lingui-race branch July 30, 2026 08:08
@vendure-ci-automation-bot vendure-ci-automation-bot Bot locked and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants